﻿[
{
    "name": "Decimal Number formatter",
    "desc": "Provides classes for formatting currencies, decimal numbers, percent values, and permille values, based on the user's languages and geographic region.",
    "source": function () {
        var decimalFormatter = new Windows.Globalization.NumberFormatting.DecimalFormatter();
        console.log("Minimum number of digits to display for the fraction part of the number " + decimalFormatter.fractionDigits);
        console.log("Region that is used when formatting and parsing decimal numbers " + decimalFormatter.geographicRegion);
        console.log("Minimum number of digits to display for the integer part of the number " + decimalFormatter.integerDigits);
        console.log("Whether the decimal point of the number should always be displayed " + decimalFormatter.isDecimalPointAlwaysDisplayed);
        console.log("Whether the integer part of the number should be grouped " + decimalFormatter.isGrouped);
        console.log("Format " + decimalFormatter.format(123456.7890));
        console.log("Parse Int " + decimalFormatter.parseInt * ("123.4567890"));
    }
},
{
    "name": "Currency formatter",
    "desc": "Formats and parses currencies.",
    "source": function () {
        var currencyFormatter = new Windows.Globalization.NumberFormatting.CurrencyFormatter("INR");
        console.log("Currency Identifier: " + currencyFormatter.currency);
        console.log("Region: " + currencyFormatter.geographicRegion);

        console.log("Formatted Currency: " + currencyFormatter.format("1234567.890"));
    }
},
{
    "name": "Calendar",
    "desc": "Manipulates the representation of a date and time within a given calendar and clock.",
    "source": function () {
        var calendar = new Windows.Globalization.Calendar();
        var clock = calendar.getClock();
        calendar.now();
        console.log(calendar.toString());

    }
},
{
    "name": "Geographic Region",
    "desc": "Describes a region. This is usually a country, but may be a macroregion.",
    "source": function () {
        var geographicRegion = Windows.Globalization.GeographicRegion("IN");
        console.log("Current region is", geographicRegion.displayName);
        console.log("Region Id", geographicRegion.id);
        console.log("Native name " + geographicRegion.nativeName);
    }
}
]